admin: Add an `unlock` command, and libostree API
authorColin Walters <walters@verbum.org>
Fri, 18 Mar 2016 19:32:58 +0000 (15:32 -0400)
committerColin Walters <walters@verbum.org>
Wed, 23 Mar 2016 15:09:09 +0000 (11:09 -0400)
commit09238da065e8a442dcffdd1f8d906f4330a6e032
tree417acc768c5364d286f02f18a9da6ca0aa1680a4
parent0b1d301d81a36c010b4b56f3e6320420b8344305
admin: Add an `unlock` command, and libostree API

I'm trying to improve the developer experience on OSTree-managed
systems, and I had an epiphany the other day - there's no reason we
have to be absolutely against mutating the current rootfs live.  The
key should be making it easy to rollback/reset to a known good state.

I see this command as useful for two related but distinct workflows:

 - `ostree admin unlock` will assume you're doing "development".  The
   semantics hare are that we mount an overlayfs on `/usr`, but the
   overlay data is in `/var/tmp`, and is thus discarded on reboot.
 - `ostree admin unlock --hotfix` first clones your current deployment,
   then creates an overlayfs over `/usr` persistent
   to this deployment.  Persistent in that now the initramfs switchroot
   tool knows how to mount it as well.  In this model, if you want
   to discard the hotfix, at the moment you roll back/reboot into
   the clone.

Note originally, I tried using `rofiles-fuse` over `/usr` for this,
but then everything immediately explodes because the default (at least
CentOS 7) SELinux policy denies tons of things (including `sshd_t`
access to `fusefs_t`).  Sigh.

So the switch to `overlayfs` came after experimentation.  It still
seems to have some issues...specifically `unix_chkpwd` is broken,
possibly because it's setuid?  Basically I can't ssh in anymore.

But I *can* `rpm -Uvh strace.rpm` which is handy.

NOTE: I haven't tested the hotfix path fully yet, specifically
the initramfs bits.
20 files changed:
Makefile-man.am
Makefile-ostree.am
buildutil/tap-test
man/ostree-admin-unlock.xml [new file with mode: 0644]
src/libostree/libostree.sym
src/libostree/ostree-deployment-private.h
src/libostree/ostree-deployment.c
src/libostree/ostree-deployment.h
src/libostree/ostree-sysroot-private.h
src/libostree/ostree-sysroot.c
src/libostree/ostree-sysroot.h
src/ostree/ot-admin-builtin-status.c
src/ostree/ot-admin-builtin-unlock.c [new file with mode: 0644]
src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-admin-builtins.h
src/ostree/ot-builtin-admin.c
src/switchroot/ostree-mount-util.c
src/switchroot/ostree-mount-util.h
src/switchroot/ostree-prepare-root.c
src/switchroot/ostree-remount.c